Class sbktech.tools.hashjava.bytecode.ClassInfo
All Packages Class Hierarchy This Package Previous Next Index
Class sbktech.tools.hashjava.bytecode.ClassInfo
java.lang.Object
|
+----sbktech.tools.hashjava.bytecode.ClassInfo
- public class ClassInfo
- extends Object
- implements VMConstants, Modifiable
The ClassInfo is the basic informational unit about a single class.
Once a class is read in, all information about it is stored,
manipulated and written out here.
ClassInfo is handed to the Obfuscator interface as a
way to obtain information about symbols defined in a Class file,
and also provide means to rename these symbols.
- Author:
- $Author: kbs $
- See Also:
- obfuscate
-
addAttribute(String, byte[])
- This adds a named attribute into a Class file.
-
affects(Method)
-
-
definedFields()
- This returns the set of fields defined in the class,
and this is the only set that should be altered.
-
definedMethods()
- This returns the set of methods defined in the class,
and this is the only set that should be altered.
-
isInnerClass()
-
-
newInnerName()
-
-
newName()
-
-
originalName()
-
-
parentScope()
-
-
permissions()
- Access permissions for this class
-
rename(String)
- Set a new name for this class.
-
toString()
-
definedFields
public Modifiable[] definedFields()
- This returns the set of fields defined in the class,
and this is the only set that should be altered.
- Returns:
- an array of Modifiables that represent the
fields defined in this class
definedMethods
public Method[] definedMethods()
- This returns the set of methods defined in the class,
and this is the only set that should be altered.
Overridden methods, or methods implemented from interfaces
are not considered to be defined in the class.
- Returns:
- an array of Methods which represent the methods
defined in this class
affects
public Hashtable affects(Method m)
- Parameters:
- m - is the method for which a dependency list is desired
- Returns:
- a Hashtable of ClassInfo entries. The Hashtable is just
a set of all classes which will have a method renamed if
method m in this class is renamed. It will always return null if
this class is not an interface.
addAttribute
public void addAttribute(String name,
byte data[])
- This adds a named attribute into a Class file.
It is just a way to embed arbitrary data into a class file.
You can use this for instance, to store copyright strings
or versioning information directly in the bytecode.
- Parameters:
- name - Name for the attribute
- data - bytes containing the data to be associated with
the name
permissions
public int permissions()
- Access permissions for this class
- Returns:
- an integer (see values in VMConstants) describing
the access permissions for this class
- See Also:
- VMConstants
originalName
public String originalName()
- Returns:
- the name for the class
newName
public String newName()
- Returns:
- the new (possibly renamed) name for this class
isInnerClass
public boolean isInnerClass()
- Returns:
- true if this class is an inner class
parentScope
public String parentScope()
- Returns:
- the name of the containing class scope if this is
an inner class
newInnerName
public String newInnerName()
- Returns:
- the name of this inner class. This can
be null or 0 length if the class is not an inner class, or if the
class is anonymous.
rename
public void rename(String n)
- Set a new name for this class. If this is an inner class, this
only renames the "inner" name.
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index